@extends('admin.layouts.index')
@section('title', '外链列表')

@section('content')
<link rel="stylesheet" href="/assets/css/links_detial.css?v=2022062009">
<div class="row">
    <div class="col-md-12">
        <div class="card">
            <div class="card-body">
                <form class="m-search" method="GET" action="{{ URL::current() }}">
                    <div class="m-search-items">
                        <div class="m-search-item">
                            <label>关键词</label>
                            <input type="text" name="keyword" placeholder="请输入关键词">
                        </div>
                        <div class="m-search-item">
                            <label>样式</label>
                            <select name="miniapp_style" name="miniapp_style">
                                <option value="1">默认</option>
                                <option value="2">自定义</option>
                            </select>
                        </div>
                        <div class="m-search-item">
                            <button class="button">搜索</button>
                        </div>
                    </div>
                </form>
                <div class="self-table-responsive">
                    <table class="table table-bordered table-nowrap">
                        <thead>
                            <tr>
                                <th scope="col">用户ID</th>
                                <th scope="col">外链ID</th>
                                <th scope="col">链接标题</th>
                                <th scope="col">链接昵称</th>
                                <th scope="col">链接描述</th>
                                <th scope="col">外链状态</th>
                                <th scope="col">小程序权限</th>
                                <th scope="col">到期时间</th>
                                <th scope="col">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            @forelse($links as $link)
                            <tr class="link_user_{{ $link->users_id }}">
                                <td>{{ $link->users_id }}</td>
                                <td>{{ $link->links_id }}</td>
                                <td>{{ $link->title }}</td>
                                <td>{{ $link->nike }}</td>
                                <td>{{ $link->describe }}</td>
                                @if($link->disable == 1)
                                <td class="text-success">可用</td>
                                @else
                                <td class="text-danger">删除</td>
                                @endif
                                @if($link->miniapp_status == 2)
                                <td class="text-success">公用</td>
                                @else
                                <td class="text-danger">私有</td>
                                @endif
                                @if($link->end_time > 1)
                                <td>{{ date("Y-m-d H:i:s",$link->end_time) }}</td>
                                @else
                                <td>-</td>
                                @endif
                                
                                <td>
                                    <div class="table-handdle-td">
                                        <a href="{{ url('admin/links_lists/links_lists_detial',['links_id'=>$link->links_id]) }}" class="table-handdle-link">外链详情</a>
                                    </div>
                                </td>
                            </tr>
                            @empty
                            <tr>
                                <td colspan="7">没有找到</td>
                            </tr>
                            @endforelse
                        </tbody>
                    </table>

                    <div class="pagination-container">
                        {!! $links->appends($condition)->render() !!}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="remarkModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content modal-self-cotain">
            <div class="modal-self-body">
                <div id="qrcodesImagesMore" style="width:100%;float: left;margin-top: 40px;">
                    <div class="row">
                        <div class="col-lg-12">
                            <label>链接备注内容:<i class="bx bxs-help-circle ms-1" data-bs-toggle="tooltip" data-bs-placement="top" title="用于区分辨别不同链接，备注不会对外展示。"></i></label>
                            <div class="m-form-item">
                                <input type="text" class="m-input" maxlength="30" placeholder="请输入30字以内链接备注。" id="remark">
                                <input type="hidden" value="" id="links_id">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-self-footer">
                <div class="m-form-item">
                    <button type="button" class="m-form-btn" onclick="ListsRemarkUpdateSubmit();" id="qrcodesModalButtonUpdate" style="margin-left:0;">立即更新</button>
                    <button type="button" class="m-form-btn m-btn-light" data-bs-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/js/dev/links-lists-detial-8gk9oda.js?v=2022070812"></script>
@endsection
